//
//  CircleView.m
//  YCT
//
//  Created by 余晋龙 on 16/9/21.
//  Copyright © 2016年 bzjc. All rights reserved.
//


#define TITLE_HEIGHT 60
#define PIE_HEIGHT 200
#define Radius kscaleHeight(55.f) //圆形比例图的半径

#import "CircleView.h"
#import "CircleMapView.h"


@interface CircleView()
{
 CircleMapView *circleView;
    id delegate;
}
@end
@implementation CircleView
-(instancetype)initWithFrame:(CGRect)frame andUrlStr:(NSString *)str
{
    
    if (self = [super initWithFrame:frame]) {
        _str = str;
        [self addCirclView:self.dataArray];  //添加饼状图
    }
    return self;
}
// 设置数据源
- (void)setDataArray:(NSMutableArray *)dataArray{
    _dataArray = dataArray;
    circleView.dataArray = self.dataArray;

}

// 添加圆形比例图
-(void)addCirclView:(NSMutableArray *)arr{
    if (!circleView) {
        circleView = [[CircleMapView alloc]initWithFrame:CGRectMake(0, 0, WIDTH(self), HEIGHT(self)) andWithDataArray:arr andWithCircleRadius:Radius];
        circleView.backgroundColor = [UIColor whiteColor];
    }
    [self addSubview:circleView];
}
@end
